package org.linlinjava.litemall.db.domain;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;

public class BusinessProject {
    private String projectId;

    private String projectExecuteYear;

    private String projectName;

    private String projectNo;

    private Integer projectLevel;

    private String projectType;

    private String projectSource;

    private String projectMoney;

    private LocalDate projectStartDate;

    private LocalDate projectEndDate;

    private String projectFilesName;

    private String dutyPersonalName;

    private String projectStatus;

    private String projectRemark;

    private Integer statusAudit;

    private String backupRemark;

    private String adminName;

    private LocalDateTime insertTime;

    private String updateAdminName;

    private LocalDateTime updateTime;

    public String getProjectId() {
        return projectId;
    }

    public void setProjectId(String projectId) {
        this.projectId = projectId;
    }

    public String getProjectExecuteYear() {
        return projectExecuteYear;
    }

    public void setProjectExecuteYear(String projectExecuteYear) {
        this.projectExecuteYear = projectExecuteYear;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public String getProjectNo() {
        return projectNo;
    }

    public void setProjectNo(String projectNo) {
        this.projectNo = projectNo;
    }

    public Integer getProjectLevel() {
        return projectLevel;
    }

    public void setProjectLevel(Integer projectLevel) {
        this.projectLevel = projectLevel;
    }

    public String getProjectType() {
        return projectType;
    }

    public void setProjectType(String projectType) {
        this.projectType = projectType;
    }

    public String getProjectSource() {
        return projectSource;
    }

    public void setProjectSource(String projectSource) {
        this.projectSource = projectSource;
    }

    public String getProjectMoney() {
        return projectMoney;
    }

    public void setProjectMoney(String projectMoney) {
        this.projectMoney = projectMoney;
    }

    public LocalDate getProjectStartDate() {
        return projectStartDate;
    }

    public void setProjectStartDate(LocalDate projectStartDate) {
        this.projectStartDate = projectStartDate;
    }

    public LocalDate getProjectEndDate() {
        return projectEndDate;
    }

    public void setProjectEndDate(LocalDate projectEndDate) {
        this.projectEndDate = projectEndDate;
    }

    public String getProjectFilesName() {
        return projectFilesName;
    }

    public void setProjectFilesName(String projectFilesName) {
        this.projectFilesName = projectFilesName;
    }

    public String getDutyPersonalName() {
        return dutyPersonalName;
    }

    public void setDutyPersonalName(String dutyPersonalName) {
        this.dutyPersonalName = dutyPersonalName;
    }

    public String getProjectStatus() {
        return projectStatus;
    }

    public void setProjectStatus(String projectStatus) {
        this.projectStatus = projectStatus;
    }

    public String getProjectRemark() {
        return projectRemark;
    }

    public void setProjectRemark(String projectRemark) {
        this.projectRemark = projectRemark;
    }

    public Integer getStatusAudit() {
        return statusAudit;
    }

    public void setStatusAudit(Integer statusAudit) {
        this.statusAudit = statusAudit;
    }

    public String getBackupRemark() {
        return backupRemark;
    }

    public void setBackupRemark(String backupRemark) {
        this.backupRemark = backupRemark;
    }

    public String getAdminName() {
        return adminName;
    }

    public void setAdminName(String adminName) {
        this.adminName = adminName;
    }

    public LocalDateTime getInsertTime() {
        return insertTime;
    }

    public void setInsertTime(LocalDateTime insertTime) {
        this.insertTime = insertTime;
    }

    public String getUpdateAdminName() {
        return updateAdminName;
    }

    public void setUpdateAdminName(String updateAdminName) {
        this.updateAdminName = updateAdminName;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", projectId=").append(projectId);
        sb.append(", projectExecuteYear=").append(projectExecuteYear);
        sb.append(", projectName=").append(projectName);
        sb.append(", projectNo=").append(projectNo);
        sb.append(", projectLevel=").append(projectLevel);
        sb.append(", projectType=").append(projectType);
        sb.append(", projectSource=").append(projectSource);
        sb.append(", projectMoney=").append(projectMoney);
        sb.append(", projectStartDate=").append(projectStartDate);
        sb.append(", projectEndDate=").append(projectEndDate);
        sb.append(", projectFilesName=").append(projectFilesName);
        sb.append(", dutyPersonalName=").append(dutyPersonalName);
        sb.append(", projectStatus=").append(projectStatus);
        sb.append(", projectRemark=").append(projectRemark);
        sb.append(", statusAudit=").append(statusAudit);
        sb.append(", backupRemark=").append(backupRemark);
        sb.append(", adminName=").append(adminName);
        sb.append(", insertTime=").append(insertTime);
        sb.append(", updateAdminName=").append(updateAdminName);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        BusinessProject other = (BusinessProject) that;
        return (this.getProjectId() == null ? other.getProjectId() == null : this.getProjectId().equals(other.getProjectId()))
            && (this.getProjectExecuteYear() == null ? other.getProjectExecuteYear() == null : this.getProjectExecuteYear().equals(other.getProjectExecuteYear()))
            && (this.getProjectName() == null ? other.getProjectName() == null : this.getProjectName().equals(other.getProjectName()))
            && (this.getProjectNo() == null ? other.getProjectNo() == null : this.getProjectNo().equals(other.getProjectNo()))
            && (this.getProjectLevel() == null ? other.getProjectLevel() == null : this.getProjectLevel().equals(other.getProjectLevel()))
            && (this.getProjectType() == null ? other.getProjectType() == null : this.getProjectType().equals(other.getProjectType()))
            && (this.getProjectSource() == null ? other.getProjectSource() == null : this.getProjectSource().equals(other.getProjectSource()))
            && (this.getProjectMoney() == null ? other.getProjectMoney() == null : this.getProjectMoney().equals(other.getProjectMoney()))
            && (this.getProjectStartDate() == null ? other.getProjectStartDate() == null : this.getProjectStartDate().equals(other.getProjectStartDate()))
            && (this.getProjectEndDate() == null ? other.getProjectEndDate() == null : this.getProjectEndDate().equals(other.getProjectEndDate()))
            && (this.getProjectFilesName() == null ? other.getProjectFilesName() == null : this.getProjectFilesName().equals(other.getProjectFilesName()))
            && (this.getDutyPersonalName() == null ? other.getDutyPersonalName() == null : this.getDutyPersonalName().equals(other.getDutyPersonalName()))
            && (this.getProjectStatus() == null ? other.getProjectStatus() == null : this.getProjectStatus().equals(other.getProjectStatus()))
            && (this.getProjectRemark() == null ? other.getProjectRemark() == null : this.getProjectRemark().equals(other.getProjectRemark()))
            && (this.getStatusAudit() == null ? other.getStatusAudit() == null : this.getStatusAudit().equals(other.getStatusAudit()))
            && (this.getBackupRemark() == null ? other.getBackupRemark() == null : this.getBackupRemark().equals(other.getBackupRemark()))
            && (this.getAdminName() == null ? other.getAdminName() == null : this.getAdminName().equals(other.getAdminName()))
            && (this.getInsertTime() == null ? other.getInsertTime() == null : this.getInsertTime().equals(other.getInsertTime()))
            && (this.getUpdateAdminName() == null ? other.getUpdateAdminName() == null : this.getUpdateAdminName().equals(other.getUpdateAdminName()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getProjectId() == null) ? 0 : getProjectId().hashCode());
        result = prime * result + ((getProjectExecuteYear() == null) ? 0 : getProjectExecuteYear().hashCode());
        result = prime * result + ((getProjectName() == null) ? 0 : getProjectName().hashCode());
        result = prime * result + ((getProjectNo() == null) ? 0 : getProjectNo().hashCode());
        result = prime * result + ((getProjectLevel() == null) ? 0 : getProjectLevel().hashCode());
        result = prime * result + ((getProjectType() == null) ? 0 : getProjectType().hashCode());
        result = prime * result + ((getProjectSource() == null) ? 0 : getProjectSource().hashCode());
        result = prime * result + ((getProjectMoney() == null) ? 0 : getProjectMoney().hashCode());
        result = prime * result + ((getProjectStartDate() == null) ? 0 : getProjectStartDate().hashCode());
        result = prime * result + ((getProjectEndDate() == null) ? 0 : getProjectEndDate().hashCode());
        result = prime * result + ((getProjectFilesName() == null) ? 0 : getProjectFilesName().hashCode());
        result = prime * result + ((getDutyPersonalName() == null) ? 0 : getDutyPersonalName().hashCode());
        result = prime * result + ((getProjectStatus() == null) ? 0 : getProjectStatus().hashCode());
        result = prime * result + ((getProjectRemark() == null) ? 0 : getProjectRemark().hashCode());
        result = prime * result + ((getStatusAudit() == null) ? 0 : getStatusAudit().hashCode());
        result = prime * result + ((getBackupRemark() == null) ? 0 : getBackupRemark().hashCode());
        result = prime * result + ((getAdminName() == null) ? 0 : getAdminName().hashCode());
        result = prime * result + ((getInsertTime() == null) ? 0 : getInsertTime().hashCode());
        result = prime * result + ((getUpdateAdminName() == null) ? 0 : getUpdateAdminName().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    public enum Column {
        projectId("project_id", "projectId", "VARCHAR", false),
        projectExecuteYear("project_execute_year", "projectExecuteYear", "VARCHAR", false),
        projectName("project_name", "projectName", "VARCHAR", false),
        projectNo("project_no", "projectNo", "VARCHAR", false),
        projectLevel("project_level", "projectLevel", "INTEGER", false),
        projectType("project_type", "projectType", "VARCHAR", false),
        projectSource("project_source", "projectSource", "VARCHAR", false),
        projectMoney("project_money", "projectMoney", "VARCHAR", false),
        projectStartDate("project_start_date", "projectStartDate", "DATE", false),
        projectEndDate("project_end_date", "projectEndDate", "DATE", false),
        projectFilesName("project_files_name", "projectFilesName", "VARCHAR", false),
        dutyPersonalName("duty_personal_name", "dutyPersonalName", "VARCHAR", false),
        projectStatus("project_status", "projectStatus", "VARCHAR", false),
        projectRemark("project_remark", "projectRemark", "VARCHAR", false),
        statusAudit("status_audit", "statusAudit", "INTEGER", false),
        backupRemark("backup_remark", "backupRemark", "VARCHAR", false),
        adminName("admin_name", "adminName", "VARCHAR", false),
        insertTime("insert_time", "insertTime", "TIMESTAMP", false),
        updateAdminName("update_admin_name", "updateAdminName", "VARCHAR", false),
        updateTime("update_time", "updateTime", "TIMESTAMP", false);

        private static final String BEGINNING_DELIMITER = "`";

        private static final String ENDING_DELIMITER = "`";

        private final String column;

        private final boolean isColumnNameDelimited;

        private final String javaProperty;

        private final String jdbcType;

        public String value() {
            return this.column;
        }

        public String getValue() {
            return this.column;
        }

        public String getJavaProperty() {
            return this.javaProperty;
        }

        public String getJdbcType() {
            return this.jdbcType;
        }

        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

        public static Column[] excludes(Column ... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
            } else {
                return this.column;
            }
        }

        public String getAliasedEscapedColumnName() {
            return this.getEscapedColumnName();
        }
    }
}